<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?><!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/public/js/html5shiv.js"></script>
    <script type="text/javascript" src="/public/js/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/Hui-iconfont/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/public/plugins/laydate/skins/default/laydate.css"/>

    <!--[if IE 6]>
    <script type="text/javascript" src="/public/js/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>快方管理后台</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

</head>
<body class="big-page">
<style type="text/css">
    .date{
        width: 100px;
    }
    .table td {
        text-align: center;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 门店管理 <span
        class="c-gray en">&gt;</span> 上传至第三方 <a class="btn btn-success radius r"  style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="Hui-article">
    <article class="cl pd-20">
        <input data-url="/Delivery/add" class="btn btn-primary radius" id="modal" type="button" value="添加配送平台">
        <div class="mt-10">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive" id="dataTables">
                <thead>
                <tr class="text-c">
                    <th>#</th>
                    <th>平台名称</th>
                    <th>权重</th>
                    <th>唯一标识</th>
                    <th>编辑</th>
                </tr>
                <?php foreach ($platform as $key=>$val){
                    ?>
                    <tr>
                        <td class="pal"><?php echo $val['ID'] ?></td>
                        <td class="pal"><?php echo $val['TL'] ?></td>
                        <td class="pal"><?php echo $val['QZ'] ?></td>
                        <td class="pal"><?php echo $val['UNIQUE'] ?></td>
                        <td class="pal">
                            <a href="javascript:void(0)" class="edit btn btn-primary radius" data-id="<?php echo $val['ID'] ?>" data-url="/Delivery/delete">编辑</a>
                        </td>
                    </tr>
                <?php
                }
                ?>

                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </article>
</div>

<script type="text/javascript" src="/public/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/plugins/layer/layer.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/public/plugins/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/public/plugins/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="/public/plugins/laydate/laydate.js"></script>
</body>
<script>
    $(".delete").click(function(){
        var _this = $(this);
        var id = _this.data('id');
        var url = _this.data('url');
        if(confirm("确认要删除？")){
            $.ajax({
                type: "POST",
                url: url,
                data: {id:id},
                dataType:"json",
                success: function(msg){
                    if(msg.code==200){
                        alert("删除成功");
                        location.reload();
                    }else{
                        
                    }
                }
            });
        }
    })
    $("#modal").click(function(){
        layer.open({
            type: 2,
            title: '添加平台',
            shadeClose: true,
            shade: 0.8,
            area: ['600px', '450px'],
            content: ['/Delivery/modal','no']
        });
    })
    $(".edit").click(function(){
        var id = $(this).data('id');
        layer.open({
            type: 2,
            title: '添加平台',
            shadeClose: true,
            shade: 0.8,
            area: ['600px', '450px'],
            content: ['/Delivery/modal?id='+id,'no']
        });
    })






</script>
</html>
